package com.cloud.swagger;

import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

@RestController
@Api(tags = "测试展示接口")
public class SwaggerController {
    @GetMapping("/swagger/show")
    @ApiOperation(value = "展示接口", notes = "根据名称 展示用户")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "姓名", required = true),

    })
    @ApiResponses({
            @ApiResponse(code = 200, message = "登录成功"),
            @ApiResponse(code = 500, message = "登录失败")})
    private PeopleVo show(@RequestParam("name") String name, HttpServletRequest request) {
        PeopleVo peopleVo = new PeopleVo();
        peopleVo.setName(name);
        return peopleVo;
    }

    @PostMapping("/file")
    @ApiOperation(value = "文件上传", notes = "文件上传")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "file", value = "文件", required = true, dataType = "MultipartFile", dataTypeClass = MultipartFile.class)

    })
    private void file(@RequestParam("file") MultipartFile file) {

    }
}
